package org.objective.base;

import java.util.Iterator;
import java.util.List;
import static org.utils.fp.collection.CollectionFactory.*;

/**
 *
 * @author gus
 */
public class CommonObjectList<T> implements Iterable<CommonObject<T>>
{
    private List<CommonObject<T>> list = newArrayList(10);

    public void add(CommonObject<T> obj)
    {
        list.add(obj);
    }

    public CommonObject<T>[] toArray()
    {
        return (CommonObject<T>[]) list.toArray();
    }

    @Override
    public Iterator<CommonObject<T>> iterator()
    {
        return list.iterator();
    }
}
